package router

import (
	"github.com/starmotioncf/soutchatinternal/handler"

	"github.com/gin-gonic/gin"
)

type ThirdCallbackRouter struct {
	thirdGameHandler *handler.ThirdGameHandler
}

func NewThirdCallbackRouter(thirdGameHandler *handler.ThirdGameHandler) *ThirdCallbackRouter {
	return &ThirdCallbackRouter{
		thirdGameHandler: thirdGameHandler,
	}
}

func (r *ThirdCallbackRouter) Register(gr gin.IRouter) {
	// third_game 第三方游戏
	r.third_game(gr)
}

// third_game 第三方游戏
func (r *ThirdCallbackRouter) third_game(gr gin.IRouter) {
	gr = gr.Group("/third_game/:account_id")
	//用户信息
	gr.POST("/userinfo", r.thirdGameHandler.GetUserInfo)
	//更新金币接口
	gr.POST("/change_gold", r.thirdGameHandler.ChangeGold)
	//增加金币接口
	gr.POST("/deposit_gold", r.thirdGameHandler.DepositGold)
	//扣减金币接口
	gr.POST("/consume_gold", r.thirdGameHandler.ConsumeGold)
	//获取token
	gr.POST("/token", r.thirdGameHandler.GetToken)
	//刷新token
	gr.POST("/refresh_token", r.thirdGameHandler.RefreshToken)
	// joyplay 比较特殊 获取用户信息
	gr.POST("/game/getUserInfo", r.thirdGameHandler.GetUserInfo)
	// joyplay 比较特殊 更新金币接口
	gr.POST("/game/submitFlow", r.thirdGameHandler.ChangeGold)
}
